package edu.bu.cs673.superkids123.children.controller;

import edu.bu.cs673.superkids123.AbstractController;
import edu.bu.cs673.superkids123.AbstractFrame;
import edu.bu.cs673.superkids123.children.controller.games.ArcheryGameController;
import edu.bu.cs673.superkids123.children.controller.games.ArithmaticGameController;
import edu.bu.cs673.superkids123.children.controller.games.MatchGameController;
import edu.bu.cs673.superkids123.children.controller.games.NumberMatchingGameController;
import edu.bu.cs673.superkids123.children.controller.games.SubtractionGameController;
import edu.bu.cs673.superkids123.children.view.ChildProfileView;
import edu.bu.cs673.superkids123.children.view.games.GameAView;
import edu.bu.cs673.superkids123.children.view.lessons.AddingLessonView;
import edu.bu.cs673.superkids123.children.view.lessons.CountingLessonView;
import edu.bu.cs673.superkids123.common.view.LoginView;
import edu.bu.cs673.superkids123.common.view.ParentsLoginView;

public class ActivitiesMenuController extends AbstractController {

	public ActivitiesMenuController(AbstractFrame mainFrame) {
		super(mainFrame);
	}

	public void back() {
		getMainFrame().changeView(LoginView.class);
	}

	public void settings() {
		getMainFrame().changeView(ParentsLoginView.class);
	}

	public void avatar() {
		getMainFrame().changeView(ChildProfileView.class);
	}

	public void launch(String activity) {
		// TODO Need to pull this information out of the model when available.
		if (activity.contains("Lesson")) {
			if (activity.contains("Count")) {
				getMainFrame().changeView(CountingLessonView.class);
			} else if (activity.contains("Add")) {
				getMainFrame().changeView(AddingLessonView.class);
			}
		} else if (activity.contains("Game")) {
			if (activity.contains("Matching")) {
				getMainFrame().getController(NumberMatchingGameController.class).startGame();
			} else if (activity.contains("Math")) {
				getMainFrame().getController(ArithmaticGameController.class).startGame();
			} else if (activity.contains("Click")) {
				getMainFrame().getController(MatchGameController.class).startGame();
			} else if (activity.contains("Archery")) {
				getMainFrame().getController(ArcheryGameController.class).startGame();
			} else if (activity.contains("Subtraction")) {
				getMainFrame().getController(SubtractionGameController.class).startGame();
			} else {
				getMainFrame().changeView(GameAView.class);
			}
		} else {
			System.err
					.println("Selected activity is neither a lesson or game!");
		}
	}
}